using System;
using System.Collections.Generic;
using System.Text;
using XinBang.Entity;
using XinBang.DAL;
using XinBang.DAL.NHibernate;

namespace XinBang.BLL
{
    public class MemberBL
    {
        private MemberDA md = new MemberDA();

        public void UpdateMember(Member mdb)
        {
            md.Update(mdb);
        }

        public Member GetMemberByEmail(string p)
        {
            return md.GetMemberByEmail(p);
        }

        public bool IsExsitByUsername(string username)
        {
            Member m = md.GetMemberByUsername(username);
            return m == null ? false : true;
        }

        public bool IsExsitByEmail(string email)
        {
            Member m = md.GetMemberByEmail(email);
            return m == null ? false : true;
        }

        public void InsertMember(Member m)
        {
            md.Insert(m);
        }

        public IList<Member> GetMemberListByLevel(string p)
        {
            return md.GetMembersByLevel(p);
        }

        public IList<Member> GetMembersByCurrentLevel(int p)
        {
            return md.GetMembersByCurrentLevel(p);
        }

        public IList<Member> GetMemberListByEmail(string email)
        {
            return md.GetMemberListByEmail(email);
        }

        public IList<Member> GetMemberListByUsername(string username)
        {
            return md.GetMemberListByUsername(username);
        }

        public Member GetMemberByMemberId(int p)
        {
            return (Member)md.Get(p);
        }

    }
}
